#pragma once

#include "List.h"

#include "Background.h"
#include "Charlie.h"
#include "BlueMonkey.h"
#include "ScoreBoard.h"
#include "Score.h"
#include "Bonus.h"
#include "InputEvent.h"

// general settings
#define CIRCUS_WINDOW_TITLE "Circus Charlie"
#define GROUND_HEIGHT 482

// score settings
#define SCORE_X 164
#define SCORE_Y 50
#define SCORE_DEFAULT "000000"
#define HIGHSCORE_X 484
#define HIGHSCORE_Y 50
#define HIGHSCORE_DEFAULT "000000"
#define BONUS_X 584
#define BONUS_Y 82
#define BONUS_DEFAULT "5000"

// lives settings
#define LIFE_PATH "Life.png"
#define LIFE_X 928
#define LIFE_Y 82
#define LIFE_W 32
#define LIFE_H 32
#define LIFE_OFFSET 5

// platform settings
#define PLATFORM_PATH "Platform.png"
#define PLATFORM_Y 380
#define PLATFORM_WIDTH 192
#define PLATFORM_HEIGHT 384

// scoreboard settings
#define SCOREBOARD_X 40
#define SCOREBOARD_Y 30

// gameplay
#define NB_LIVES 3

// bonus points per tick
#define BONUS_PTS_TICK 10

// applaude switch texture tick
#define APPLAUDE_TICK 0.25

class Circus: public Component {
private: 
	float currentTime;
	int lives;
	bool isGameOver;
	bool hasWon;
	char* currentTexture;
	Background *background;
	Sprite *platform;
	Sprite *gameOver;
	List<Sprite*> *livesSprites;
	Charlie *charlie;
	ScoreBoard *scoreboard;
	Score *score;
	Score *hiScore;
	Bonus *bonus;
	List<Monkey*> *monkeys;
	void SpawnMonkey();
	void ResetMonkeys();
	void BackToStart();
	void End();
public:
	Circus();
	virtual ~Circus();
	Background *GetBackground() { return background; }
	Charlie *GetCharlie() { return charlie; }
	List<Monkey*> *GetMonkeys() { return monkeys; }
	Sprite *GetPlatform() { return platform; }
	Score *GetScore() { return score; }
	void Update(float);
	void ScrollBy(int);
	void LoseLife();
};